package com.springboot.cloud.demos.feign.service;

import com.springboot.cloud.common.core.entity.vo.Result;
import com.springboot.cloud.demos.entity.form.AlbumForm;
import com.springboot.cloud.demos.entity.po.Album;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name = "ribbon-consumer", fallback = AlbumServiceFallback.class)
public interface AlbumService {

    @RequestMapping(value = "/album", method = RequestMethod.POST)
    Result save(@RequestBody AlbumForm albumForm);

    @RequestMapping(value = "/album/getAlbum", method = RequestMethod.GET)
    Result<List<Album>> getAlbum(@RequestParam("momentId") String momentId);

    @RequestMapping(value = "/album/{id}", method = RequestMethod.GET)
    Result get(@PathVariable(value = "id") String id);

    @RequestMapping(value = "/album/deleteByUrl", method = RequestMethod.POST)
    Result deleteByUrl(@RequestBody AlbumForm albumForm);

    @RequestMapping(value = "/album/{id}", method = RequestMethod.DELETE)
    Result delete(@PathVariable(value = "id") String id);
}
